{% extends "admin/base.html" %}

{% load static %}

{% block title %}{{ title }} | {{ site_title|default:_('Django site admin') }}{% endblock %}

{% block extrastyle %}
{{ block.super }}
<style>
:root {
    --primary: #0d6efd;
    --secondary: #6c757d;
    --success: #198754;
    --info: #0dcaf0;
    --warning: #ffc107;
    --danger: #dc3545;
    --light: #f8f9fa;
    --dark: #212529;
}

/* 覆盖Django Admin的默认样式 */
#header {
    background-color: var(--primary);
    color: white;
}

#branding h1 {
    color: white;
}

.module h2, .module caption, .inline-group h2 {
    background-color: var(--primary);
    color: white;
}

div.breadcrumbs {
    background-color: var(--secondary);
    color: white;
}

.button, input[type=submit], input[type=button], .submit-row input, a.button {
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
}

.button:hover, input[type=submit]:hover, input[type=button]:hover, .submit-row input:hover, a.button:hover {
    background-color: #0b5ed7;
}

.object-tools a {
    background-color: var(--success);
    color: white;
    border-radius: 4px;
    padding: 8px 16px;
}

.object-tools a:hover {
    background-color: #157347;
}

/* 表格样式优化 */
#changelist table thead th {
    background-color: var(--light);
    color: var(--dark);
}

#changelist table tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.1);
}

/* 表单样式优化 */
input[type=text], input[type=password], input[type=email], input[type=url],
input[type=number], textarea, select, .vTextField {
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 6px 12px;
}

input[type=text]:focus, input[type=password]:focus, input[type=email]:focus,
input[type=url]:focus, input[type=number]:focus, textarea:focus, select:focus,
.vTextField:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* 消息样式 */
.messagelist .success {
    background-color: var(--success);
    color: white;
}

.messagelist .warning {
    background-color: var(--warning);
    color: var(--dark);
}

.messagelist .error {
    background-color: var(--danger);
    color: white;
}

/* 响应式调整 */
@media (max-width: 767px) {
    #header {
        padding: 10px;
    }
    
    #branding h1 {
        font-size: 18px;
    }
    
    .object-tools {
        float: none;
        margin-bottom: 10px;
    }
}
</style>
{% endblock %}

{% block branding %}
<h1 id="site-name">
    <a href="{% url 'admin:index' %}">
        <i class="bi bi-tools"></i> {{ site_header|default:_('Django administration') }}
    </a>
</h1>
{% endblock %}

{% block nav-global %}{% endblock %}
